<template>
    <van-tabbar route>
        <van-tabbar-item v-for="(item,index) in list" :key="index" replace :to="item.route" icon="home-o">
            {{item.name}}
        </van-tabbar-item>
    </van-tabbar>
</template>

<script lang="ts">
import {Tabbar,TabbarItem} from 'vant'
export default {
    components:{
        [Tabbar.name]:Tabbar,
        [TabbarItem.name]:TabbarItem
    },
    data(){
        return {
            list:[
                {name:'首页',route:'/'},
                {name:'分类',route:'/bar'},
                {name:'购物车',route:'/car'},
                {name:'我的',route:'/my'},
            ]
        }
    }
}
</script>